Verbs which get information about a unit or group :
time delta: Returns number of seconds since the named unit changed state
time delta of string -- unit name
Result: integer -- in seconds
example : if time delta of "Garage Motion" is greater than 3 * minutes then
turnoff "Garage Lights"
end if
Every time XTension changes the value of a database item, it also changes the last time stamp for the unit.
This verb will return the number of seconds since the named unit or group was last changed by XTension, whether from autonomous input or by a script. IE: time of last change to database for that unit/group.
last timestamp: Get the last timestamp for a unit
last timestamp of string -- unit name
Result: integer -- timestamp in seconds
example : display dialog "The door bell last rang at " & ¬
time string for last timestamp of "Door Bell"
This verb returns the value of the last timestamp for the given unit or group. IE: time of last change to database for that unit/group.
status: Get the status of a unit
status of string -- unit name
Result: 'unen' -- unit status
example : if status of "Garage Motion" is true then
turnon "Outside Siren"
end if
This verb provides the basic function of getting the current status of any unit or group in the database.
The result is a value which can be tested for true/false. False = 0 , True ≠ 0
value: Get the analog value of a unit
value of string -- unit name
Result: small integer
example : if value of "Temperature" is greater than 70 then
turnoff "Heating"
end if
This verb returns the analog value of a unit. If the unit is 'dimmable', then this value can be set via the 'DIM' verb, or through the control panel. The value can range from 0 to 100.
query: Send a status request to a unit and receive status response
query of string
Result: small integer
example : if query of "Driveway Motion" is true then
write log "Someone is moving at the front driveway sensor"
end if
This verb provides a method of issuing the X-10 standrd 'status request' to devices which respond to such commands. Recent devices have been developed which will respond to this command with the current value of the unit's state. At the current time, only discrete values are returned from any unit which honors this X-10 command. This means only True/False can be tested.